-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hierarchical relations across tags #2435
Conversation
That's really awesome! Thank you so much for that! By the way, does your "tree system" advice you what is the next tag you could/should use? Like - I tag a sentence as "past simple". Would it suggest me to tag the person (first, second, third) or even "phrasal verb" or "slang" and/or "spoken language"? |
This tag structure is mainly intended to facilitate the exploration/navigation across tags, so that we can have a clearer view of which tags exist and easily find the information we want. I believe what you mention is out of the focus of my project, but would indeed be so helpful! I think it could be achieved by either rule-based or data-based (correlation) systems. Anyway, this project is a starting point towards tags categorization and consistent management, let's keep dreaming big! |
I've taken a first look at your PR and noticed the following: 1 You base your work on a pretty old code version (from March 4th) so I highly recommend to update the code in your dev environment and then rebase your work. |
Thank you for your feedback !
|
You are creating a new table. |
@Ynue Good job with the PR. 👍 There is something I don’t really understand however. Do we have to have a tag just for the sake grouping tags?
It means we will have tags such as |
@AndiPersti Thank you for clarifying, I will convert the table creation with the Migration plugin. @jiru If a sentence is tagged with a certain tag, then it does not need to be tagged by its parents: for example if a sentence is tagged I could have implemented this structure another way, by creating a new entity that would have acted as "parent" tags and only served as containers for "child" tags (sentences would not have been taggable with these containers), but I did not do so for the following reason: there may be some cases where we have a generic parent tag (e.g. |
@Ynue Thanks for clarifying. I see your point. But I think we should handle this case more seamlessly. If I take your example, how are we going to tag sentences about dogs? With both How are we going to change dolphin sentences from |
@AndiPersti I have solved your first three points and partially the fourth for now (only the ordering) 😃 @jiru Would you suggest creating a separate table that would serve only as container for tags? I indeed now realize it would be more relevant, especially when dealing with tag deletion which is really hard to handle with the structure I implemented. It should not take much time to transition from the current implementation to the one you suggest. |
…he autocompletion module mode general
@AndiPersti Thank you again for checking my code! To be sure not to make mistakes anymore, I have used the command line to create migrations. 😃 @jiru I have just recoded everything under a more general and external structure. I created "superTags" that serve as containers for tags, which can contain both tags and superTags. Also, I have adapted the autocompletion module to be more general and applicable onto any table, rather than only on tags (I needed autocompletion for superTags as well). |
@Ynue Thanks for proactively solve the issue I pointed out. I wanted to answer you but I was getting too tired to wrap it up in my mind yesterday. I’m going to review your code. |
@Ynue My apologies for taking so long. Your new implementation solves the problems I mentioned. 👍 But there are still lots of things that can be improved. 🙂 I’ll focus on the database schema because that’s what we need to get right before the rest. I’d like to suggest using the name "tags categories" instead of "super tags". I think naming is important and it’s hard to change it afterwards, so let’s take some time to think about it. In terms of database schema, I suggest the following changes:
For clarity, from now on, I’ll refer to these tables the way I suggested renaming them into. About the field As opposed to that, using the table name About the You haven’t used the Tree behavior yet; is there a reason for that? From what I can see, it looks like the Tree behavior allows operations such as counting the total number of childs or getting an arbitrary large subset of the tree in just a single SQL query. I suspect your implementation wouldn’t scale so much on a large tree. |
@AndiPersti Thank you so much for your thorough review! 👍 Another possibility the Tree behaviour allows for is handling the position of the leaves of a node, which means we could reorder them, say with arrows somewhere near the names. Is this feature useful? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…gs and tags categories alphabetically
This problem should be solved now (it was because of a typo). |
I changed the way to generate the tree: instead of relying on the |
I think this PR is ready for merge. However, the way we are going to create the tree is still very unclear. Currently, your code gives read-write access to the tree to any advanced user and above, like for tags. But this approach has proven to generate a mess. This is perfect for testing out, but it’s definitely not the way we are going to create the real tree. We need to think this through with the community first. Just in case, I’d like that we make this clear by making the page unavailable on production. (And also putting the translatable strings in a different domain so that they do not end up on Transifex yet.) So I can merge the PR and do these changes. Is everyone okay with that? |
Sounds good to me. |
It's okay for me! Besides, I believe the translatable strings have to be reviewed in order to better fit to Tatoeba's interface. |
The way we are going to create the tree is still unclear. Giving read-write access to the tree to any advanced user and above, like for tags, is perfect for testing out, but it’s definitely not the way we are going to create the real tree. We need to think this through with the community first. Refs #2435.
There is no need to have translators translate these strings yet. To avoid having these ending up on Transifex, I put them in a separate domain, just like we currently do for admin pages. Refs #2435.
This page is not ready for production yet. Refs #2435.
This pull request does not correspond to any specific, but rather is an answer to several issues (#333, #961). This corresponds to my current work for the Kodoeba event.
This contribution aims to provide a way to hierarchically organize tags by allowing tags to have children. For example the tag
grammar
could have two childrentense
andaspect
, andtense
could havepast
as a child.I created a new table called
TagsLinks
that stores the relation between tags. I have not use theTree
behaviour from CakePHP for the only reason that I did not know it existed before implementing, I may consider simplifying my code using this behaviour.Because I wanted to add autocompletion to the form that enables to specify a new relation between two tags, I made the autocompletion script from sentence/show more general and transformed it into a reusable module.
Finally, I inspired myself from the wall tickets to display the tags arborescence.